import React from "react";


export default class List extends React.Component {

    constructor(props){
        super(props)
        this.state = {
            disk:"cyoe"
        }
        
    }

    handleChange = (e) => {
       
            this.setState({
                disk: e.target.value
            })
           
            this.props.onHandleChange(e.target.value)
    }


    componentDidMount() {
       
        this.props.onHandleChange(this.state.disk)
        console.log("list组件挂载完毕")
    }

    render() {
    
        return(
            <div>
                <input type="text"  value={this.state.disk}  onChange={this.handleChange}/> 
                <button>submit</button>
            </div>
        )
    }
   
}